package newclasses;

import java.util.Iterator;
import java.util.Vector;

import temp.TypeConverter;

public class Samples {

	
	private Vector<Short> samples;


	
	public Samples(Vector<Byte> samples) {
	
		Iterator<Byte> i = samples.iterator();
		this.samples = new Vector<Short>();
		
	
		while(i.hasNext())
		{
			
			this.samples.add( TypeConverter.byteSignedToUnsegned( i.next())  );
		}
	}
	
	
	public Vector<Byte> convertToBytes(){
		Vector<Byte> bytes = new Vector<Byte>(samples.size());
		
		Iterator<Short> iterator = samples.iterator();
		
		while(iterator.hasNext()){
			short temp = iterator.next();
			bytes.add((byte)temp);
		}
		return bytes;
	}
		

}
